﻿#ifndef SAPP_H_
#define SAPP_H_

#include <QApplication>
#include "ConfigFile.h"


#define sApp static_cast<SApp*>(qApp)



class SApp : public QApplication
{
private:
	ConfigFile* m_globalConfig{};
	void initGlobalConfig();


	QVariantMap m_userData;


public:
	SApp(int argc, char* argv[]);

	inline ConfigFile* globalConfig() 
	{ 
		if (!m_globalConfig)qWarning() << "global Config is nullptr"; return m_globalConfig; 
	}

	void setUserData(const QString& key, const QVariant& data);
	QVariant userData(const QString& key);

};

#endif // !SAPP_H_
